import 'package:flutter/material.dart';
import 'package:lite_message/style/lm_icons.dart';

import 'package:lite_message/util/app_util.dart';

///返回按钮
class BackIcon extends StatelessWidget {
  final double size;

  final double borderRadius;

  final Color bgColor;

  const BackIcon({
    Key key,
    this.size = 40,
    this.borderRadius = 200,
    this.bgColor,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: size,
      height: size,
      child: FlatButton(
        padding: EdgeInsets.zero,
        materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
        color: bgColor ?? Theme.of(context).bottomAppBarColor,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(borderRadius),
        ),
        onPressed: () {
          Navigator.pop(context);
        },
        child: Icon(
          LmIcons.back,
          color: Theme.of(context).accentColor,
          size: 40.px,
        ),
      ),
    );
  }
}
